<?php
	
	namespace app\ajax\controller;
	class Common{
		// 获取地区信息
		public function area(){
			$where = ['parent_id' => input('get.id')];
			if(input('target_type') && input('target_type') != 'undefined') $where[input('target_type')] = '1';
			$arealist = db('area')->where($where)->select();
			return $arealist;
		}
		function category(){
			$where = ['PID'=>input('get.id')+0,'IsShow'=>'1','id'=>['not in',[36,37,38,39,40,41,42,43]]];
			$data = db('product_cate')->where($where)->select();
			return $data;
		}
		function hype($id=''){
			if($id > 0){
				$data = db('hype_area')->where(['page_id' => $id])->order('Sort asc,id asc')->select();
			}else{
				$data = db('hype_page')->order('Sort asc,id asc')->select();
			}
			return $data;
		}
	}